package com.dragon.refect.classload;

/**
 * 常量测试演示案例
 * 助记符: ldc表示将int,float或是String类型的常量值从常量池中推送至栈顶
 *        bipush表示将单字节(-128 ~ 127)的常量值推送至栈顶
 *        sipush表示将一个短整形(short)常量值(-32768 ~ 32767)推送至栈顶
 *        iconst_i表示将int类型1推送至栈顶(iconst_1 ~ iconst_5)
 *        ldc2_w表示将double类型的常量值推送至栈顶
 *
 * @author dragon
 * @since 2019/11/16
 */
public class ConstClassTest {

    public static void main(String[] args) {
        System.out.println(MyParent2.M);
    }
}

class MyParent2 {

    public static final String STR = "hello world";

    public static final short S = 127;

    public static final int I = 128;

    public static final int M = 6;

    public static final int H = 1343412312;

    public static final double D = 12.342;

    public static final float F = 12.34F;

    static {
        System.out.println("MyParent2 static block");
    }
}
